overrideTxRedeemers
overrideTxRedeemers( tx: Tx, newRedeemers: TxRedeemer[] ): Tx
tx
:Tx
newRedeemers
:TxRedeemer
[]
Replaces the redeemers and clears vkeyWitnesses in the witness set
and re-computes the scriptDataHash
in the body
This might be needed in some rare cases where the plutus script calculation is offset by some units.
The input transaction is readonly and is not modified.
A NEW TRANSACTION IS CREATED with vkey witness set empty (the new transaction is unsigned)
to summarize, the new transaction differs in:
tx.body.scriptDataHash
tx.witnesses.redeemers
tx.witnesses.vkeyWitnesses
(empty)
the new transaction is unsigned
empty vkeyWitnesses implies any signature present in the input transaction is discarded
this is because the transaction body changed, so the signature would be invalid.
if you use this method make sure to request the user to sign the transaciton ONLY AFTER modifying redeemers